;; -*- coding: utf-8 -*-
;;----------------------------------------------------------------------------
;; 括号自动匹配
;;----------------------------------------------------------------------------
(make-local-variable 'skeleton-pair-alist)

(setq skeleton-pair-alist
      '((?\" _ "\"" >)
        (?\( _ ")" >)
        (?\[ _ "]" >)
        (?\{ _ "}" >)))

(setq skeleton-pair t)

;; (global-set-key (kbd "(")  'skeleton-pair-insert-maybe)
;; (global-set-key (kbd "{")  'skeleton-pair-insert-maybe)
;; (global-set-key (kbd "\"") 'skeleton-pair-insert-maybe)
;; (global-set-key (kbd "[")  'skeleton-pair-insert-maybe)

(defun my-skeleton-pair-hook ()
  (local-set-key (kbd "(")  'skeleton-pair-insert-maybe)
  (local-set-key (kbd "{")  'skeleton-pair-insert-maybe)
  (local-set-key (kbd "\"") 'skeleton-pair-insert-maybe)
  (local-set-key (kbd "[")  'skeleton-pair-insert-maybe))

(add-hook 'c-mode-common-hook 'my-skeleton-pair-hook)
(add-hook 'c++-mode-common-hook 'my-skeleton-pair-hook)
(add-hook 'emacs-lisp-mode-hook 'my-skeleton-pair-hook)
(add-hook 'lisp-mode-hook 'my-skeleton-pair-hook)
(add-hook 'org-mode-hook 'my-skeleton-pair-hook)


(provide 'init-editing-utils)
